package jblip.apps.clip.cmds;

import jblip.BlipClient;
import jblip.apps.clip.ClipPrinter;
import jblip.resources.UserPicture;

public class GetAvatar extends ClipCommand {

  @Override
  public void execute(BlipClient client, String[] args) {
    UserPicture avatar = client.getAvatar(args[0]);
    if (client.getLastError() == null) {
      ClipPrinter.print(avatar);
    } else {
      System.out.println("ERROR: " + client.getLastError());
    }
  }

  @Override
  public String getName() {
    return "avatar";
  }

  @Override
  public String getUsageMessage() {
    return "<user name>";
  }

}
